package com.flink.func;

import com.flink.pojo.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * WaterSensorMapFunction
 *
 * @author caizhiyang
 * @since 2024-02-26
 */
public class WaterSensorMapFunction implements MapFunction<String, WaterSensor> {
    @Override
    public WaterSensor map(String s) throws Exception {
        String[] data = s.split(",");
        return new WaterSensor(data[0], Long.valueOf(data[1]), Integer.valueOf(data[2]));
    }

}
